# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Clément DEMOULINS <clement@archivel.fr>

pkgname=python-networkx
pkgver=2.8.8
pkgrel=3
pkgdesc='Python package for the creation, manipulation, and study of the structure, dynamics, and functions of complex networks.'
arch=('any')
license=('BSD')
url="https://networkx.org/"
depends=('python-numpy' 'python-scipy' 'python-matplotlib' 'python-pandas')
optdepends=('python-lxml: for GraphML XML format'
            'python-pydot: for graph drawing and graph layout algorithms via GraphViz'
            'python-yaml: for YAML format reading and writing')
# python-pygraphviz: for graph drawing and graph layout algorithms via GraphViz
makedepends=('python-setuptools')
checkdepends=('python-pytest-runner' 'python-lxml' 'python-pydot' 'python-yaml')
source=("https://github.com/networkx/networkx/archive/networkx-$pkgver.tar.gz")
sha512sums=('ea38b34184e69254fd245281ce09b88059f786cadca6250ea0507c286346e609fcc2fac2849de09b4419a91a7200e4e9940f23b65dd460380af1fc1cf75304fe')

build() {
  cd networkx-networkx-$pkgver
  python setup.py build
}

check() {
  cd networkx-networkx-$pkgver
  python setup.py pytest
}

package() {
  cd networkx-networkx-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1
  install -D -m 644 LICENSE.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE.txt
  mv "$pkgdir"/usr/share/doc/networkx-$pkgver "$pkgdir"/usr/share/doc/$pkgname
}
